Allow for changing pull ups for Wire pins #103
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've added a setPullups() function. This allows users to select between 0, 1.5k, 6k, 12k, and 24k, for the built in pull ups on the I2C lines. Because we call begin() after user selects their pull up values, I needed to store clock speed.
I addition, I moved the iomTransfer setup of default values to the begin function. This was done for SPI as well to decrease the amount of cycles spent setting up values for every I2C transfer. It won't save as much time as the SPI change did, but it will cut it down a bit. It does increase RAM footprint by the size of iomtransfer but I'm not worried about it.
I chose to allow user to pass a uint32_t to the setPullups() function. If desired, we could pass the full HAL type def of am_hal_gpio_pullup_e but I think it's easier to use a bare number.